#include <iostream>
#include <cmath>
using namespace std;

int main()
{
    float a = 0;
    char b = ' ';
    cin >> a >> b;
    int ret = 20;
    if (a - 1.0 > 0.0)
    {
        ret += ceil(a - 1);
    }

    if (b == 'y') cout << ret + 5;
    else cout << ret;
    return 0;
}